package com.wowangz.cms.systemmanage.sms.send.service;

import java.io.IOException;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.wowangz.cms.common.utils.FreeMarkerResolve;
import com.wowangz.cms.systemmanage.sms.smsset.entity.SmsSet;

import freemarker.template.TemplateException;

public class SendMessageService {

	private static Logger logger = LoggerFactory.getLogger(SendMessageService.class);

	public void send(){
		//String name = SendMessage.SMSURL + "usename=";
	}
	
	/**
	 * @author HUANGYUAN
	 * @description 发送短信
	 * @param variable
	 *            模板中的变量
	 * @param smsSet
	 *            短信模板对象
	 * @时间 2015年10月12日 上午9:40:49
	 */
	public void sendSmsMessage(Map<String, String> variable, SmsSet smsSet) {
		if (smsSet != null) {
			try {
				FreeMarkerResolve.freemarkerProcess(variable, smsSet.getTemplatecontent());
			} catch (IOException e) {
				logger.debug(e.getMessage());
				e.printStackTrace();
			} catch (TemplateException e) {
				logger.debug(e.getMessage());
				e.printStackTrace();
			}
		}
	}
}
